<?php
$sids = $_SESSION["ArraySec"];
if($_SESSION['Permit']==1)
 { 
 $sql = "Select tblresource.* From tblresource  ";
 }


$rs = mysql_query($sql)or die(mysql_error());

?>
<script language="javascript" type="text/javascript">
function delResource(rid){
	if(confirm("Bạn có chắc chắn muốn xóa tài nguyên này?")){
		location="rsd?rid="+rid;
	}
}
</script>
<table width="100%">
	<tr>
		<td colspan="5" ><h3>Quản lý tài nguyên</h3></td>
		<td align="right" colspan="2">
			<a href="rsa" title="Tạo tài nguyên mới">
				<img src="img/Add.png" style="border:none;" width="32" height="32"/>
			</a>
		</td>
	</tr>
	
	<tr style="background: #008000;color: white;height:30px;">
		<th width="5%">STT</th>
		<th >Tên tiếng Việt</th>
		<th >Tên tiếng Anh</th>
	
		<th >Link</th>
		
		<th >Thực hiện</th>
	</tr>
	<?php
		$i=1;
		while($resource = mysql_fetch_object($rs)){
	?>
		<tr style="background:#e7e7e7;">
			<td align='center'><?php echo $i++; ?></td>
			<td><?php echo $resource->vi_name;?></td>
			<td><?php echo $resource->en_name;?></td>
			<td align="center"><a href='<?php echo $resource->link;?>' title='<?php echo $resource->link?>'>Link</a></td>
			<td align='center'><a href='rse?rid=<?php echo $resource->id;?>'>Sửa</a> | <a href='' onclick='delResource(<?php echo $resource->id ?>);return false;'>Xóa</a></td>
		</tr>
	<?php	
		}
	?>
</table>
